Imaging devices, such as a camera mounted in a mobile terminal, for example, a mobile phone, a smartphone, or a tablet terminal, and a digital camera have been widely used recently. Thus, there are more opportunities to perform photographing of a digital image for people in general.
When performing photographing by using a mobile terminal or an imaging device as described above, due to a depth of field which is determined by characteristics of an optical system and a condition for photographing, blur is caused in an object which is distant in a depth direction from a main object which is in focus. Here, the depth of field represents an object-side distance range of an object which is in focus in an image. For example, in a case where a scene including both a near view and a distant view is photographed under a condition that the depth of field is shallow, blur is caused in an object in the distant view when an object in the near view is in focus, and blur is caused in the object in the near view when the object in the distant view is in focus.
Accordingly, when a focal position is erroneously determined, an object which is desired to be photographed by a user is not in focus and blur is caused. In a mobile terminal or an imaging device as described above, an auto focus (AF) function for automatically focusing on an object is widely used, but an object is erroneously in focus by the AF in some cases. For example, there is a case where a focal position is erroneously determined in a background when photographing is performed by approaching an object at a short distance. There may also be a case where any objects which are photographed are not in focus and an image in which all of them are blurring is provided.
Thus, it is desired to acquire a high-quality image having no blur and all objects in focus without focusing on only the object in the near view or the object in the distant view.
PTL 1 described below proposes a technique of acquiring an image (hereinafter, also referred to as an “all-in-focus image”) having an enlarged depth of field by focusing on all objects from a near view to a distant view. With this technique, by moving a focusing lens in an optical axis direction by a focusing lens driver, AF and focus-bracket photographing are performed. The all-in-focus image is acquired based on a plurality of images acquired by consecutively photographing an object with focus bracketing photographing while changing a focal position.